package com.turbo.listener;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

@Component
public class CancelPayListener {

    @RabbitListener(queues = "queue.dlx",ackMode = "MANUAL")
    public void onMessage(Message message, Channel channel) throws IOException {
        System.out.println("已取消超时订单,订单编码："+new String(message.getBody(),message.getMessageProperties().getContentEncoding()));
    }
}
